package com.yanqu.road.server.cmd.activity.stronghold.eliminate;

import com.yanqu.road.entity.activity.ActivityInfo;
import com.yanqu.road.pb.activity.StrongholdWarProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.manger.activity.strongholdwar.StrongholdActivityMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.GameProtocol;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = GameProtocol.S_STRONGHOLD_WAR_ELIMINATION_MEMBER_DAMAGE,desc = "获取淘汰赛联盟战报")
public class GetEliminateReportDetailCmd extends AbstractCommand {
    private int type;
    private int id;
    private int id2;
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        StrongholdWarProto.GetEliminateReportDetailReqMsg req = StrongholdWarProto.GetEliminateReportDetailReqMsg.parseFrom(packet.getBytes());
        id = req.getId();
        type = req.getType();
        id2 = req.getId2();
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        StrongholdWarProto.CrossGetEliminateReportDetailReqMsg.Builder msg = StrongholdWarProto.CrossGetEliminateReportDetailReqMsg.newBuilder();
        ActivityInfo activityInfo = StrongholdActivityMgr.getOpenActivityInfo();
        if (activityInfo != null) {
            int activityId = activityInfo.getActivityId();
            msg.setActivityId(activityId);
            msg.setType(type);
            msg.setId(id);
            msg.setId2(id2);
            player.sendUnionActivityGroupPacket(Protocol.C_ROSS_STRONGHOLD_ELIMINATE_REPORT_DETAIL, msg, msg.getActivityId());
        }
    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
